/**
 * <p>Title: LongteamPlan.java</p>
 * <p>Description: </p>
 * <p>Copyright: Baosight Software LTD.co Copyright (c) 2002</p>
 * <p>Company: Baosight Software</p>
 * @author 张志芳
 * @version 1.0
 * <pre>Histroy:
 *          2013-8-22 上午08:03:50  张志芳  Create
 *</pre>
 */
package com.baosight.sczx.common.zm.cInterface.cb;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.baosight.iplat4j.core.spring.SpringApplicationContext;
import com.baosight.iplat4j.dao.Dao;

/**
 * <p>Title: LongteamPlan.java</p>
 * <p>Description: 中长期计划接口</p>
 * <p>Copyright: Baosight Software LTD.co Copyright (c) 2002</p>
 * <p>Company: Baosight Software</p>
 * @author 张志芳
 * @version 1.0
 * <pre>Histroy:
 *          2013-8-22 上午08:03:50  张志芳  Create
 *</pre>
 */
public class LongteamPlan {
	private static Dao dao = (Dao)SpringApplicationContext.getBean("dao");

	
	/**
	 * 根据年份获取明细记录
	 * <p>Function: getPlanDetails</p>
	 * <p>Description: </p>
	 * <p>return value:List<ZMCBPlanDetails></p>
	 * <p>throws Exception:</p>
	 * <p>History:
	 *    2013-8-22上午08:17:20 张志芳
	 * </p>
	 *
	 */
	@SuppressWarnings({ "unchecked", "rawtypes" })
	public static List<Map> getPlanDetails(String year){
		Map map = new HashMap();
		map.put("fdYear", year);
		List<Map> list = dao.query("ZMCBLongteamPlan.queryInterface", map);//查询是否包含某年的生效计划
		if(list.size()>0){
			map.clear();
			map.put("fdForeignKey", list.get(0).get("fdKeyId"));
			List<Map> details = dao.query("ZMCBPlanDetails.queryInterface", map);
			if(details.size()>0){
				return details;
			}
			return null;
		}		
		return null;
	}
}
